/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package toesp.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author satria.sp
 */
@Entity
@Table(name = "kesetaraan")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Kesetaraan.findAll", query = "SELECT k FROM Kesetaraan k")})
public class Kesetaraan implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "kesetaraan_id")
    private Integer kesetaraanId;
    
    //--------------------------------------------------------------------------
    @Basic(optional = false)
    @Column(name = "kesetaraan_kode")
    private String kuliahIdKesetaraan;
    @Basic(optional = false)
    @Column(name = "kuliah_kode")
    private String kuliahId;
    //--------------------------------------------------------------------------
    @JoinColumn(name = "kesetaraan_kode", referencedColumnName = "kuliah_id", insertable = false, updatable = false)
    @ManyToOne
    private Kuliah kuliahKesetaraan;
    @JoinColumn(name = "kuliah_kode", referencedColumnName = "kuliah_id", insertable = false, updatable = false)
    @ManyToOne
    private Kuliah kuliah;

    public Kesetaraan() {
    }

    public Kesetaraan(Integer kesetaraanId) {
        this.kesetaraanId = kesetaraanId;
    }

    public Integer getKesetaraanId() {
        return kesetaraanId;
    }

    public void setKesetaraanId(Integer kesetaraanId) {
        this.kesetaraanId = kesetaraanId;
    } 
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (kesetaraanId != null ? kesetaraanId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Kesetaraan other = (Kesetaraan) obj;
        if ((this.kuliahIdKesetaraan == null) ? (other.kuliahIdKesetaraan != null) : !this.kuliahIdKesetaraan.equals(other.kuliahIdKesetaraan)) {
            return false;
        }
        if ((this.kuliahId == null) ? (other.kuliahId != null) : !this.kuliahId.equals(other.kuliahId)) {
            return false;
        }
        return true;
    }

    /**
     * @return the kuliahIdKesetaraan
     */
    public String getKuliahIdKesetaraan() {
        return kuliahIdKesetaraan;
    }

    /**
     * @param kuliahIdKesetaraan the kuliahIdKesetaraan to set
     */
    public void setKuliahIdKesetaraan(String kuliahIdKesetaraan) {
        this.kuliahIdKesetaraan = kuliahIdKesetaraan;
    }

    /**
     * @return the kuliahId
     */
    public String getKuliahId() {
        return kuliahId;
    }

    /**
     * @param kuliahId the kuliahId to set
     */
    public void setKuliahId(String kuliahId) {
        this.kuliahId = kuliahId;
    }

    /**
     * @return the kuliahKesetaraan
     */
    public Kuliah getKuliahKesetaraan() {
        return kuliahKesetaraan;
    }

    /**
     * @param kuliahKesetaraan the kuliahKesetaraan to set
     */
    public void setKuliahKesetaraan(Kuliah kuliahKesetaraan) {
        this.kuliahKesetaraan = kuliahKesetaraan;
    }

    /**
     * @return the kuliah
     */
    public Kuliah getKuliah() {
        return kuliah;
    }

    /**
     * @param kuliah the kuliah to set
     */
    public void setKuliah(Kuliah kuliah) {
        this.kuliah = kuliah;
    }
}
